package com.cqz.tools;


import net.sf.json.util.PropertyFilter;

import java.sql.Timestamp;

public class MyJsonConfig {
    public static net.sf.json.JsonConfig cfg = new net.sf.json.JsonConfig();
    public static net.sf.json.JsonConfig data_cfg = new net.sf.json.JsonConfig();



    //过滤关联，避免死循环net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
    static {
        cfg.setJsonPropertyFilter(new PropertyFilter()
        {
            public boolean apply(Object source, String name, Object value) {
                if(name.equals("lastUpdate")) {
                    return true;
                } else {
                    return false;
                }
            }
        });
        //net.sf.json.JSONException: java.lang.reflect.InvocationTargetException异常
        cfg.setExcludes(new String[]{"handler","hibernateLazyInitializer"});

    }
}
